<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
</head>

<body class="gray-bg">

<div class="panel panel-default center">
    <div class="panel-body" style="text-align:left;display: flex;overflow-x: scroll">
        <div style="display: inline-block;margin-left: 3%;">
            <div style="font-weight: bolder;font-size: 15px;text-align: center;margin-bottom: 10px;">小程序二维码</div>
            <div id="miniQrcode" ></div>
        </div>
        <div id="grad" style="display: inline-block;margin-left: 10%;">
            <div style="font-weight: bolder;font-size: 15px;text-align: center;margin-bottom: 10px;">对外第三方二维码</div>
             <div id="hlhtQrcode" ></div>
        </div>
        <div id="grad1" class="hide miniGrad" style="display: inline-block;margin-left: 10%">
            <div style="font-weight: bolder;font-size: 15px;text-align: center;margin-bottom: 10px;">小程序二维码</div>
            <div id="qrcode" ></div>
        </div>
    </div>
<%--    <div class="panel-body" style="text-align:right;">--%>
<%--        <div id="qrcodeWechat" style="display: inline-block"></div>--%>
<%--    </div>--%>

    <div class="panel-footer" >
<%--        <div>自有品牌二维码可用于自有用户扫码启动充电</div>--%>
<%--        <div id="code1">对外第三方二维码可用于第三方平台用户扫码启动充电</div>--%>
<%--        <div>自有品牌二维码内容：<b>${qrcode}</b></div>--%>
<%--        <div id="code2">对外第三方二维码内容：<b>${hlhtQrcode}</b></div>--%>
        <div id="code3">小程序二维码：<b>${miniQrcode}</b></div>
        <span style="color: red;text-align:center;">建议使用草料二维码工具（<a href="https://cli.im" style="color: blue">https://cli.im</a>）进行美化设计</span>
<%--        <button onclick="$('.miniGrad').toggleClass('hide')">小程序二维码</button>--%>
    </div>
</div>

<script type="text/javascript">
    // 设置要生成二维码的链接
    var qrcode = new QRCode(document.getElementById("qrcode"), {width: 150, height: 150});
    qrcode.clear();
    qrcode.makeCode('${qrcode}');
    var qrcode3 = new QRCode(document.getElementById("miniQrcode"), {width: 200, height: 200});
    qrcode3.clear();
    qrcode3.makeCode('${miniQrcode}');
    <%--if ('${hlhtQrcode}' == ''){--%>
    <%--    console.log(1)--%>
    <%--}--%>
    <%--console.log('${hlhtQrcode}');--%>
    <%--alert('${hlhtQrcode}');--%>
    if ('${hlhtQrcode}' != '')
    {
        // $('#grad').css('display','none');
        var hlhtQrcode = new QRCode(document.getElementById("hlhtQrcode"), {width: 150, height: 150});
        hlhtQrcode.clear();
        hlhtQrcode.makeCode('${hlhtQrcode}');
    }else{
        $('#grad').css('display','none');
        $('#code1').css('display','none');
        $('#code2').css('display','none');
        $('#code3').css('display','none');
    }
    // 设置要生成微信授权二维码的链接
    <%--var qrcodeWechat = new QRCode(document.getElementById("qrcodeWechat"), {width: 150, height: 150});--%>
    <%--qrcodeWechat.clear();--%>
    <%--qrcodeWechat.makeCode('${qrcodeWechat}');--%>
</script>
</body>
</html>
